IndexOfMinimum Generic Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Finds the index of the minimum value in a list. A supplied IComparer<T> is used to compare the items in the collection.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public static int IndexOfMinimum<T>(
	IList<T> list,
	IComparer<T> comparer
)
Visual Basic (Declaration)
Public Shared Function IndexOfMinimum(Of T) ( _
	list As IList(Of T), _
	comparer As IComparer(Of T) _
) As Integer
Visual C++
public:
generic<typename T>
static int IndexOfMinimum (
	IList<T>^ list, 
	IComparer<T>^ comparer
)

Parameters

list
IList<(Of <T>)>
The list to search.
comparer
IComparer<(Of <T>)>
The comparer instance used to compare items in the collection.

Return Value

The index of the smallest item in the list. If the minimum value appears multiple times, the index of the first appearance is used.

Type Parameters

T
The type of items in the list.

Exceptions

ExceptionCondition
System..::InvalidOperationExceptionThe collection is empty.
System..::ArgumentNullExceptionlist or comparer is null.

See Also